wtcumsum = wtcumsum+w0/wsum; wthresh0 = wtcumsum; 
wtcumsum = wtcumsum+w1/wsum; wthresh1 = wtcumsum; 
wtcumsum = wtcumsum+w2/wsum; wthresh2 = wtcumsum; 
wtcumsum = wtcumsum+w3/wsum; wthresh3 = wtcumsum; 
wtcumsum = wtcumsum+w4/wsum; wthresh4 = wtcumsum; 
wtcumsum = wtcumsum+w5/wsum; wthresh5 = wtcumsum; 
wtcumsum = wtcumsum+w6/wsum; wthresh6 = wtcumsum; 
wtcumsum = wtcumsum+w7/wsum; wthresh7 = wtcumsum; 
wtcumsum = wtcumsum+w8/wsum; wthresh8 = wtcumsum; 
wtcumsum = wtcumsum+w9/wsum; wthresh9 = wtcumsum; 
wtcumsum = wtcumsum+w10/wsum; wthresh10 = wtcumsum; 
wtcumsum = wtcumsum+w11/wsum; wthresh11 = wtcumsum; 
wtcumsum = wtcumsum+w12/wsum; wthresh12 = wtcumsum; 
wtcumsum = wtcumsum+w13/wsum; wthresh13 = wtcumsum; 
wtcumsum = wtcumsum+w14/wsum; wthresh14 = wtcumsum; 
wtcumsum = wtcumsum+w15/wsum; wthresh15 = wtcumsum; 
wtcumsum = wtcumsum+w16/wsum; wthresh16 = wtcumsum; 
wtcumsum = wtcumsum+w17/wsum; wthresh17 = wtcumsum; 
wtcumsum = wtcumsum+w18/wsum; wthresh18 = wtcumsum; 
wtcumsum = wtcumsum+w19/wsum; wthresh19 = wtcumsum; 
wtcumsum = wtcumsum+w20/wsum; wthresh20 = wtcumsum; 
wtcumsum = wtcumsum+w21/wsum; wthresh21 = wtcumsum; 
wtcumsum = wtcumsum+w22/wsum; wthresh22 = wtcumsum; 
wtcumsum = wtcumsum+w23/wsum; wthresh23 = wtcumsum; 
wtcumsum = wtcumsum+w24/wsum; wthresh24 = wtcumsum; 
wtcumsum = wtcumsum+w25/wsum; wthresh25 = wtcumsum; 
wtcumsum = wtcumsum+w26/wsum; wthresh26 = wtcumsum; 
wtcumsum = wtcumsum+w27/wsum; wthresh27 = wtcumsum; 
wtcumsum = wtcumsum+w28/wsum; wthresh28 = wtcumsum; 
wtcumsum = wtcumsum+w29/wsum; wthresh29 = wtcumsum; 
wtcumsum = wtcumsum+w30/wsum; wthresh30 = wtcumsum; 
wtcumsum = wtcumsum+w31/wsum; wthresh31 = wtcumsum; 
wtcumsum = wtcumsum+w32/wsum; wthresh32 = wtcumsum; 
wtcumsum = wtcumsum+w33/wsum; wthresh33 = wtcumsum; 
wtcumsum = wtcumsum+w34/wsum; wthresh34 = wtcumsum; 
wtcumsum = wtcumsum+w35/wsum; wthresh35 = wtcumsum; 
wtcumsum = wtcumsum+w36/wsum; wthresh36 = wtcumsum; 
wtcumsum = wtcumsum+w37/wsum; wthresh37 = wtcumsum; 
wtcumsum = wtcumsum+w38/wsum; wthresh38 = wtcumsum; 
wtcumsum = wtcumsum+w39/wsum; wthresh39 = wtcumsum; 
wtcumsum = wtcumsum+w40/wsum; wthresh40 = wtcumsum; 
wtcumsum = wtcumsum+w41/wsum; wthresh41 = wtcumsum; 
